﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace ElingOA6_Admin_DSJCJ.BLL
{
    /// <summary>
    /// 信息文档呈送 逻辑类
    /// </summary>
    public class DocReference
    {
        /// <summary>
        /// 信息文档呈送DAL
        /// </summary>
        private DAL.DocReference docReferenceDAL = new DAL.DocReference();
        public DocReference()
        {
        }

        /// <summary>
        /// 获得数据列表
        /// <creator>wangl</creator>
        /// <date>2014-03-13</date>
        /// </summary>
        public List<ElingOA6_Admin_DSJCJ.Model.DocReference> GetListByDocId(string entityNo,decimal docId)
		{
            DataSet ds = docReferenceDAL.GetListByDocId(entityNo, docId);
			return DataTableToList(ds.Tables[0]);
		}
		/// <summary>
		/// 获得数据列表
		/// </summary>
		public List<ElingOA6_Admin_DSJCJ.Model.DocReference> DataTableToList(DataTable dt)
		{
			List<ElingOA6_Admin_DSJCJ.Model.DocReference> modelList = new List<ElingOA6_Admin_DSJCJ.Model.DocReference>();
			int rowsCount = dt.Rows.Count;
			if (rowsCount > 0)
			{
				ElingOA6_Admin_DSJCJ.Model.DocReference model;
				for (int n = 0; n < rowsCount; n++)
				{
                    model = docReferenceDAL.DataRowToModel(dt.Rows[n]);
					if (model != null)
					{
						modelList.Add(model);
					}
				}
			}
			return modelList;
		}

    }
}
